package com.example.coding_problem;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.widget.Toast;

public class SQLenvironmental_indicators extends SQLiteOpenHelper {
    public SQLenvironmental_indicators(Context context) {
        //数据库名字
        super(context, "EnvironmentalLndicators", null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table info(_id integer PRIMARY KEY AUTOINCREMENT,temperature varchar(20),humidity varchar(20),Illumination varchar(20),CQ2 varchar(20),pm varchar(20),road_condition varchar(20))");
    }

    public void onUpgrade(SQLiteDatabase db, int i, int i1) {
       db.execSQL("alter table info add phone varchar(11)");
    }
}